package com.app.studyroom.api;

import com.google.gson.annotations.SerializedName;

public class ApiResponse<T> {

    @SerializedName("code")
    private int code;

    @SerializedName("message")
    private String message;

    @SerializedName("data")
    private T data;

    @SerializedName("token")
    private String token; // 有些接口（如登录、注册）返回 token

    // Getter 方法
    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public T getData() {
        return data;
    }

    public String getToken() {
        return token;
    }

    // 简单判断是否成功
    public boolean isSuccess() {
        return code == 200;
    }
}
